<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui" template="/paginas/template.xhtml">

	<ui:define name="corpoForm">
		
		<h:form id="formAlterarSenha" prependId="false">

			<p:panelGrid columns="1" styleClass="botoes" id="botoes">
				<p:commandButton value="#{rsc.label_salvar}" styleClass="botao"
					action="#{manterUsuarioBean.alterarSenha}" ajax="false"
					onclick="setTimeout('document.getElementById(\'' + this.id + '\').disabled=true;', 50);"
					rendered="#{p:ifGranted('ALTERAR_USUARIO')}"
					title="#{rsc.title_alterar}" />
			</p:panelGrid>

			<p:panel id="pnlInfo" header="#{rsc.label_alterarSenha}"
				toggleable="true" toggleSpeed="500">

				<p:panelGrid columns="2" styleClass="two-columns">

					<p:outputLabel value="#{rsc.label_senhaAtual}" for="txtSenhaAntiga"
						styleClass="obrigatorio" />

					<p:password label="#{rsc.label_senhaAtual}" id="txtSenhaAntiga" autocomplete="off"
						maxlength="150" size="40" title="#{rsc.label_senhaAtual}"
						feedback="false" value="#{manterUsuarioBean.entidade.password}" />

					<p:outputLabel value="#{rsc.label_novaSenha}" for="txtSenhaNova"
						styleClass="obrigatorio" />

					<p:password label="#{rsc.label_novaSenha}" id="txtSenhaNova" autocomplete="off"
						maxlength="150" size="40" title="#{rsc.label_novaSenha}"
						value="#{manterUsuarioBean.entidade.novaSenha}"
						feedback="true" promptLabel="#{rsc.label_promptSenha}"
						weakLabel="#{rsc.label_passwordFraco}" match="txtConfirmarSenha"
						validatorMessage="#{msg.senhasIncorretas}"
						goodLabel="#{rsc.label_passwordMedio}"
						strongLabel="#{rsc.label_passwordSeguro}"
						requiredMessage="#{rsc.label_novaSenha}: #{msg.errorCampoObrigatorio}" />

					<p:outputLabel value="#{rsc.label_confirmarSenha}" autocomplete="off"
						for="txtConfirmarSenha" styleClass="obrigatorio" />

					<p:password label="#{rsc.label_confirmarSenha}"
						id="txtConfirmarSenha" maxlength="150" size="40"
						title="#{rsc.label_confirmarSenha}" feedback="false"
						value="#{manterUsuarioBean.entidade.novaSenha}" />

				</p:panelGrid>
			</p:panel>
			
			<p:watermark value="#{rsc.wm_senhaAtual}" for="txtSenhaAntiga" />
			<p:watermark value="#{rsc.wm_senhaNova}" for="txtSenhaNova" />
			<p:watermark value="#{rsc.wm_senhaConfirmar}" for="txtConfirmarSenha" />
		</h:form>
	</ui:define>
</ui:composition>

